-
Notifications
You must be signed in to change notification settings - Fork 22
A more precise way to specify flags #1133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| , f.format | ||
| , if f.options.isDefault then " (default)" else "" | ||
| , "." | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can still have flexibility on the help for the flag by providing a rendering function like this.
parserFromFlags offers that flexibility and parserFromFormatFlags takes that flexibility away so we can be consistent.
8c202b9 to
3ab349e
Compare
3ab349e to
db9f485
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the overall changes but OverloadedRecordDot & NoFieldSelectors need to be removed: #1133 (comment) and #1133 (comment)
e8cef26 to
0df0d3a
Compare
0df0d3a to
3fbc48c
Compare
Comments addressed
Jimbo4350
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| import Options.Applicative (Parser) | ||
| import Options.Applicative qualified as Opt | ||
|
|
||
| -- | Create a parser from a help rendering function and list of flags. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice haddock 👍
6538092 to
9e9f0bb
Compare
9e9f0bb to
c5bd903
Compare
|
Addresses #566 |
Changelog
Context
A new way to specify flags in code that makes the default flag specification more concise and DRY whilst making it easier to standardise on flag help wording whilst still providing flexibility.
How to trust this PR
Highlight important bits of the PR that will make the review faster. If there are commands the reviewer can run to observe the new behavior, describe them.
Checklist